import { Button } from '@tarojs/components'
import { ViewComponent } from './components'
import { generateUniqueId } from '../utils/key'

export class ButtonView implements ViewComponent {
  constructor(private label: string, private onClick: () => void) {}
  render() {
    return <Button id={generateUniqueId('id-')} onClick={() => this.onClick()}>{this.label}</Button>
  }
}
